
<li class="layui-form-item icon">
    <label class="layui-form-label">ICON：</label>
    <div class="layui-input-block icon_box">

        <?php if ($data['icon'] != 'alpha.gif' && $data['icon'] != '') {?>
                <img src="/uploadfiles/<? echo $theme_folder ?>/<? echo $data['icon'] ?>" width="100"/>
        <?php } ?>

<hr/>
        <a href="javascript:detele_file(<? echo $data['nid'] ?>,'icon')">
            删除</a>
         
    </div>
</li>

<li class="layui-form-item icon">
    <label class="layui-form-label">上传文件：</label>
    <div class="layui-input-block">
        <input type="file" name="icon" onchange="fileChange(this);"/>
    </div>
</li>






<li class="layui-form-item icon">
    <label class="layui-form-label">附件：</label>
    <div class="layui-input-block file_box">

        <?php if ($data['filename'] != 'alpha.gif' && $data['filename'] != '') {?>
            <img src="/uploadfiles/<? echo $theme_folder ?>/<? echo $data['filename'] ?>" width="100"/>
        <?php } ?>
        <hr/>

        <a href="javascript:detele_file(<? echo $data['nid'] ?>,'file')">
            删除</a>
    </div>
</li>

<li class="layui-form-item icon">
    <label class="layui-form-label">上传文件：</label>
    <div class="layui-input-block">
        <input type="file" name="filename" onchange="fileChange(this);"/>
    </div>
</li>



<script type="application/javascript">
    function detele_file(nid,type){
        $.ajax({
            type: "GET",
            url: "../controller/delete-file.php?nid="+nid+"&type="+type

            success: function (data) {


                if (data.error==0) {

                    $(type+'box').html('')
                    alert("操作成功");

                }
                else
                {
                    alert("操作失败");

                }


            }
        });
    }
</script>
